package com.situ.student.service.impl;

import com.situ.student.dao.ClassesDao;
import com.situ.student.dao.ClassesDao;
import com.situ.student.dao.impl.ClassesDaoImpl;
import com.situ.student.dao.impl.ClassesDaoImpl;
import com.situ.student.model.Classes;
import com.situ.student.model.Classes;
import com.situ.student.service.ClassesService;
import com.situ.student.util.BeanFactory;
import com.situ.student.util.Pagination;

import java.util.List;

public class ClassesServiceImpl implements ClassesService {
    private final ClassesDao classesDao = BeanFactory.getBean(ClassesDaoImpl.class);
    @Override
    public List<Classes> findAll(Pagination pagination, Classes classes) {
        return classesDao.findAll(pagination, classes);
    }

    @Override
    public int deleteByIds(int id) {
        return classesDao.deleteByIds(id);
    }

    @Override
    public boolean save(Classes classes) {
        return classesDao.save(classes)==1;
    }

    @Override
    public boolean update(Classes classes) {
        return classesDao.update(classes)==1;
    }

    @Override
    public Classes findById(Integer id) {
        return classesDao.findById(id);
    }
}
